package com.example.qy160demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.qy160demo.dao.EmpDao;
import com.example.qy160demo.entity.Emp;
import com.example.qy160demo.service.EmpService;
import com.example.qy160demo.vo.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class EmpServicelmpl implements EmpService {

    @Resource
    private EmpDao empDao;

    @Override
    public Result<IPage<Emp>> listByPage(Integer currentPage, Integer pageSize) {
        Page<Emp> page = new Page<>(currentPage, pageSize);
        IPage<Emp> empIPage = empDao.queryTest(page, null);
        return new Result<>(200,"查询成功",empIPage);
    }

    @Override
    public Result<IPage<Emp>> delemp(Integer empno) {
        int i = empDao.deleteById(empno);
        return new Result(200,"删除成功",i);


    }


}
